﻿//using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Configuration;
using System.Configuration;

namespace Global
{
    public static class Config
    {
        readonly static IConfiguration config = new ConfigurationBuilder()
            .AddJsonFile("appsettings.json").Build();

        public static class Template
        {
            readonly static IConfigurationSection section = config.GetSection("Templates");
            public static class SMS
            {
                static IConfigurationSection sms = section.GetSection("sms");
                public static string Register
                {
                    get
                    {
                        return sms.GetSection("Register").Value;
                    }
                }

                public static string Logon
                {
                    get
                    {
                        return sms.GetSection("Logon").Value;
                    }
                }
            }

            public static int RememberDays
            {
                get
                {
                    return Convert.ToInt32(
                        System.Configuration.ConfigurationManager.AppSettings["rememberDays"]);
                }
            }


        }
    }
}
